home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…ch: Other People's Memory / ADC Developer CD (1993-03) (''Other People's Memory'')_iso / Dev.CD Mar 93.iso / Technical Documentation / Sample Code / DTS.Lib & Samples / DTS.Chat / TRootObj.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-22  |  1.8 KB  |  91 lines  |  [TEXT/MPS ]

  1. /*
  2. ** Apple Macintosh Developer Technical Support
  3. **
  4. ** File:        TRootObj.c
  5. ** Written by:    Eric Soldan
  6. **
  7. ** Copyright © 1992 Apple Computer, Inc.
  8. ** All rights reserved.
  9. */
  10.  
  11.  
  12.  
  13. /* See the files "=How to write your app" and "=Using TreeObj.c" for information
  14. ** on this function. */
  15.  
  16. /* This file isn't really used for much here.  The whole hierarchical document usage of
  17. ** DTS.Chat is very limited.  It isn't actually needed at all.  This file is here just
  18. ** so that there is more parallelism between DTS.Chat and other samples.  Also, you may
  19. ** wish to expand this sample in such a way as to use the hierarchical document package.
  20. ** You are ready to do so if you so choose, as the minimum (this file) is already done. */
  21.  
  22.  
  23.  
  24. /*****************************************************************************/
  25.  
  26.  
  27.  
  28. #include "App.h"            /* Get the application includes/typedefs, etc.    */
  29. #include "App.Common.h"        /* Get the stuff in common with rez.            */
  30. #include "App.protos.h"        /* Get the prototypes for application.            */
  31.  
  32. #ifndef __OSEVENTS__
  33. #include <OSEvents.h>
  34. #endif
  35.  
  36. #ifndef __OSUTILS__
  37. #include <OSUtils.h>
  38. #endif
  39.  
  40. #ifndef __QUICKDRAW__
  41. #include <Quickdraw.h>
  42. #endif
  43.  
  44. #ifndef __STRING__
  45. #include <String.h>
  46. #endif
  47.  
  48. #ifndef __UTILITIES__
  49. #include "Utilities.h"
  50. #endif
  51.  
  52.  
  53.  
  54. #pragma segment DrawObjects
  55. long    TRootObj(TreeObjHndl hndl, short message, long data)
  56. {
  57.     short    fileRefNum;
  58.     char    *cptr;
  59.  
  60.     switch (message) {
  61.         case FREADMESSAGE:
  62.             fileRefNum = data;
  63.             return(ReadTreeObjData(hndl, fileRefNum));
  64.             break;
  65.  
  66.         case FWRITEMESSAGE:
  67.             fileRefNum = data;
  68.             return(WriteTreeObjData(hndl, fileRefNum));
  69.             break;
  70.  
  71.         case VHMESSAGE:
  72. #if VH_VERSION
  73.             cptr = ((VHFormatDataPtr)data)->data;
  74.             ccatchr(cptr, 13, 2);
  75.             VHRootInfo(hndl, cptr);
  76.             ccatchr(cptr, 13, 2);
  77.             VHFileRecInfo(hndl, cptr);
  78.             return(true);
  79. #endif
  80.             break;
  81.  
  82.         default:
  83.             break;
  84.     }
  85.  
  86.     return(noErr);
  87. }
  88.  
  89.  
  90.  
  91.